class CBFrame extends JFrame
{
    JPanel cp = new JPanel();

    CBFrame(){
        setSize(300, 200);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JButton b = new JButton("F");
        b.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                cp.setBackground(new Color((float)Math.random(),
                                           (float)Math.random(),
                                           (float)Math.random()));
            }
        });
        JPanel p = new JPanel();
        p.add(b);
        Container pane = getContentPane();
        pane.add(p, "South");
        pane.add(cp, "Center");
    }
}
